Skip to content

Conversation

@mbcorona
Copy link
Member

@mbcorona mbcorona commented Feb 9, 2026

Fixed a regression in 2.9.1 where httpHeaders were ignored on iOS.

Fixes flutter/flutter#182015

The Fix:
Updated FVPAVFactory.m to use [AVURLAsset URLAssetWithURL:options:] instead of [AVAsset assetWithURL:]. The previous implementation dropped the options dictionary containing the headers.

Verification:
Verified manually with Wireshark.

  • 2.9.1: Headers missing.
  • 2.9.2 (Fix): Headers present.

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter].
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue that this PR fixes] in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy].
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under.
  • All existing and new tests are passing.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@google-cla
Copy link

google-cla bot commented Feb 9, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully addresses a regression in video_player_avfoundation where HTTP headers were being ignored. The core change correctly utilizes AVURLAsset URLAssetWithURL:options: to ensure that HTTP headers are properly passed, restoring the expected functionality. The CHANGELOG.md and pubspec.yaml files have been updated to reflect this important fix and version bump.

- (NSObject<FVPAVAsset> *)URLAssetWithURL:(NSURL *)URL
options:(nullable NSDictionary<NSString *, id> *)options {
return [[FVPDefaultAVAsset alloc] initWithAsset:[AVAsset assetWithURL:URL]];
return [[FVPDefaultAVAsset alloc] initWithAsset:[AVURLAsset URLAssetWithURL:URL options:options]];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This change correctly resolves the regression by using AVURLAsset URLAssetWithURL:options: instead of AVAsset assetWithURL:. This ensures that HTTP headers are properly passed to the asset, which is a critical fix for the player's functionality when dealing with authenticated or custom header-dependent streams.

@stuartmorgan-g
Copy link
Collaborator

test-exempt: currently infeasible to test

Unfortunately we don't have a good way to test this:

  • This is the intentionally-minimal wrapper (it's supposed to be a direct passthrough, and wasn't only because of a mistake) that's replaced during unit tests to make everything else testable, so isn't part of normal unit tests.
  • We can't meaningfully unit test the wrapper because the returned object isn't inspectable (e.g., we can't actually check that the options were set)
  • Ideally we would integration test that headers work, but that requires a local server (like what we do with webview_flutter integration tests with a local web server) that serves video responses, and my previous attempts to get that working failed.

This is very low risk for regression, since this code is never intended to change; it should be an absolutely minimal wrapper of the underlying API, and the initial regression was only because it was wrong in the initial PR (due to a mistake in incremental work while I was creating the PR). Given that, and that we don't currently have a mechanism for testing it, I'm exempting it.

@stuartmorgan-g
Copy link
Collaborator

This will just need a CLA to proceed.

Copy link
Contributor

@LouiseHsu LouiseHsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once CLA is signed.

@mbcorona mbcorona force-pushed the fix/ios-headers-regression branch from 427b1d3 to 56694b6 Compare February 11, 2026 20:33
@stuartmorgan-g
Copy link
Collaborator

FYI, even once you sign the CLA you will probably need to fix some local git configuration, rewrite the commit, and force-push. Currently the CLA check is showing a @Brunos-MacBook-Pro.local address for the commit author, which isn't going to match the signed CLA.

@mbcorona mbcorona force-pushed the fix/ios-headers-regression branch from 56694b6 to e29ca8e Compare February 11, 2026 20:58
@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 12, 2026
@stuartmorgan-g
Copy link
Collaborator

CLA is happy now, so landing. Thanks for finding my mistake here!

@auto-submit auto-submit bot merged commit af1d610 into main Feb 12, 2026
81 checks passed
@auto-submit auto-submit bot deleted the fix/ios-headers-regression branch February 12, 2026 15:56
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 12, 2026
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Feb 12, 2026
flutter/packages@1e50195...af1d610

2026-02-12 brunocorona.alcantar@gmail.com [video_player_avfoundation]
Fix regression where http headers were ignored (flutter/packages#10991)
2026-02-12 47866232+chunhtai@users.noreply.github.com [ci] Adds more ci
checks for batch release file integrity (flutter/packages#10859)
2026-02-12 stuartmorgan@google.com [google_maps_flutter] Create SDK 9
and 10 packages for iOS (flutter/packages#10852)
2026-02-12 katelovett@google.com Update codeowners
(flutter/packages#11004)
2026-02-11 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
67323de to 44a626f (1372 revisions) (flutter/packages#10999)
2026-02-11 stuartmorgan@google.com [video_player] Convert iOS unit tests
to Swift (flutter/packages#10989)
2026-02-11 47866232+chunhtai@users.noreply.github.com [ci] updates
`update-release-info` to support batch release (flutter/packages#10958)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: video_player platform-ios platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http headers in iOS are not being sent

4 participants